package chapter_8.coll;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

public class Test4 {

    public static void main(String[] args) {
        List<Integer> list = new ArrayList<>();

        list.add(3);
        list.add(5);
        list.add(7);
        list.add(8);
        list.add(9);
        list.add(20);

        //集合转数组
        Object[] array = list.toArray();
        Integer[] array1 = list.toArray(new Integer[]{});
        //数组转集合

        List<Integer> list1 = Arrays.asList(12, 3, 43, 4, 5, 6, 6, 7, 7, 8, 8, 8);
        Integer[] ints = new Integer[]{3,4,4,55};
        List<Integer> list2 = Arrays.asList(ints);

//        Collections.shuffle(list);
//        System.out.println(list);

//        int index = Collections.binarySearch(list, 9);
//        System.out.println(index);
    }
}
